/* eslint-disable react-hooks/exhaustive-deps */
import { useDispatch, useSelector } from 'react-redux'
import { useEffect } from 'react'
import { getChannel } from '@/store/actions/channels'
export default function useChannel () {
  const dispatch = useDispatch()
  useEffect(() => {
    // 请求频道数据
    dispatch(getChannel())
  }, [])
  // 频道数据
  const channelList = useSelector((state) => state.channels)

  return channelList
}
